package com.dwxt.cdms.controller;

import com.dwxt.cdms.base.Page;
import com.dwxt.cdms.entity.LbWatchData;
import com.dwxt.cdms.entity.vo.LbWatchWarnVO;
import com.dwxt.cdms.service.LbWatchDataService;
import com.dwxt.common.base.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RequestMapping("/cdms/lbdata")
@RestController
public class LbWatchDataController {

    @Autowired
    private LbWatchDataService lbWatchDataService;

    /**
     * 分页查询
     */
    @RequestMapping("/page")
    public BaseResult page(Page page,Integer customerId, String name ,String type) {
        return lbWatchDataService.page(page,customerId,type);
    }

    /**
     * 按用户分组查询最新数据并分页
     * @param page
     * @param name
     * @return
     */
    @RequestMapping("/pageGroup")
    public BaseResult pageGroup(Page page, String name,String type){
        return lbWatchDataService.pageGroup(page,name,type);
    }

    /**
     * 新增
     */
    @RequestMapping("/add")
    public BaseResult add(LbWatchData lbWatchData) {
        return lbWatchDataService.add(lbWatchData);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public BaseResult delete(Integer id){
        return lbWatchDataService.delete(id);
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public BaseResult update(LbWatchData lbWatchData){
        return  lbWatchDataService.update(lbWatchData);
    }


    /**
     * 修改
     */
    @RequestMapping("/selectLbWarnPage")
    public BaseResult selectLbWarnPage(Page page, LbWatchWarnVO lbWatchWarnVO){
        return  lbWatchDataService.selectLbWarnPage(page,lbWatchWarnVO);
    }

}

